﻿using BW.MesProject.BasicData.Domain.基础;
using BW.MesProject.Public.ErrorCode;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BW.MesProject.BasicData.Infrastructure
{
    /// <summary>
    /// 消费者服务接口
    /// 定义消费者相关的业务操作
    /// </summary>
    public interface IConsumerServices
    {
        /// <summary>
        /// 添加消费者
        /// </summary>
        /// <param name="model">消费者模型</param>
        /// <returns>添加结果</returns>
        ApiResult<int> AddConsumer(Consumermodel model);
        
        /// <summary>
        /// 删除消费者
        /// </summary>
        /// <param name="id">消费者ID</param>
        /// <returns>删除结果</returns>
        ApiResult<int> DeleteConsumer(long id);
        
        /// <summary>
        /// 获取所有消费者
        /// </summary>
        /// <returns>消费者列表</returns>
        ApiResult<List<Consumermodel>> GetAllConsumer();
        
        /// <summary>
        /// 根据ID获取消费者
        /// </summary>
        /// <param name="id">消费者ID</param>
        /// <returns>消费者信息</returns>
        ApiResult<Consumermodel> GetConsumerById(long id);
        
        /// <summary>
        /// 修改消费者信息
        /// </summary>
        /// <param name="model">消费者模型</param>
        /// <returns>修改结果</returns>
        ApiResult<int> UpdateConsumer(Consumermodel model);
        
        /// <summary>
        /// 分页查询消费者
        /// </summary>
        /// <param name="Consumercode">消费者编码（可选）</param>
        /// <param name="Consumername">消费者名称（可选）</param>
        /// <param name="pageindex">页码</param>
        /// <param name="pagesize">每页大小</param>
        /// <returns>分页结果</returns>
        ApiPaging<List<Consumermodel>> GetConsumer(string? Consumercode, string? Consumername,int pageindex, int pagesize);
    }
}
